package C30;

/**
 * ClassName: Code03_MissingNumber
 * Package: C30
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/12/17 15:24
 * @Version 1.0
 * @Since 1.0
 */
public class Code03_MissingNumber {
    public static void main(String[] args) {
        int[] arr = {0, 1,3,4};
        System.out.println(process(arr));
    }

    public static int process (int[] num) {
        int ero = 0;
        int eorAll = 0;
        for (int i = 0; i < num.length; i++) {
            eorAll = eorAll ^ i;
            ero ^= num[i];
        }
        eorAll ^= num.length;
        return eorAll ^ ero;
    }
}
